<script type="text/javascript">
    var GlobalValue = {};
    var GlobalName = {};
    var DefaultRowDeleted;
    /*
        $(document).ready(function () {
        $(".TravelContents").hide();
    $(".notice").hide();
    SetGlobalValues();
    SetMask();
    SetTravelSelectBox();
    ChangeContents();
    setDefault();
    EventUserDelete();
    //PaymentSelect();
    if ($("input[name=COMPANY_CODE]").val() != "1060") {
        SetCurrencySelectBox();
    }
        });
    */
    function EventUserDelete() {
        apOrgEvent.put("StaffNameOrgDiv_delete", ClearUserInfo);
    }
    function ClearUserInfo() {
        $('#staffCode').val("");
        $('#DeptName').val("");
        $('#position').val("");
        $(".input_COMPANY_CODE").html("");
        $("input[name=COMPANY_CODE]").val("");
        $(".input_CC_NAME").html("");
        $("input[name=CC_NAME]").val("");
    }
    function DeleteDefaultRow() {
        if (!DefaultRowDeleted) {
            $("#TbItem .addedTr:last").prev().remove();
            count_TbItem();
        }
        DefaultRowDeleted = true;
    }
    function setDefault() {
        $("#input_StaffNameOrgDiv").attr("contentEditable", "false");
        $("#Term1").val(1);
        $("#Term2").val(0);
        $("#returnAmount").focusout(function () {
            //alert(replaceAll($("#returnAmount").val(),",",""));
            if ($("#returnAmount").val() == "") {
                $("#returnAmount").val("0.00");
            }
            if ($("#cashAmount").val() == "") {
                $("#cashAmount").val("0.00");
            }
            if ($("#reportTotal").val() == "") {
                $("#reportTotal").val("0.00");
            }
            var returnAmount = parseFloat(replaceAll($("#returnAmount").val(), ",", ""));
            var cashAmount = parseFloat(replaceAll($("#cashAmount").val(), ",", ""));
            var ExpenseAmount = parseFloat(replaceAll($("#reportTotal").val(), ",", ""));
            if (cashAmount > ExpenseAmount) {
                if (returnAmount > ExpenseAmount) {
                    alert("冲减预支金额不能大于报销金额；");
                    returnAmount = ExpenseAmount;
                    $("#returnAmount").val(fmoney(returnAmount, 2));
                    $("#returnAmount").focus();
                }
            } else if (ExpenseAmount > cashAmount) {
                if (returnAmount > cashAmount) {
                    alert("冲减预支金额不能大于预支金额；");
                    returnAmount = cashAmount;
                    $("#returnAmount").val(fmoney(returnAmount, 2));
                    $("#returnAmount").focus();
                }
            }
            //alert(fmoney((ExpenseAmount-returnAmount),2));
            $("#dueToAmount").val(fmoney((ExpenseAmount - returnAmount), 2));
            $("#dueToAmount_span").html(fmoney((ExpenseAmount - returnAmount), 2));
//$("#returnAmount").val(parseFloat($("#daySubsidy").val().replace(",",""))*parseFloat($("#Term1").val()));
        });
    }
    function accountInputDivControl() {
        $("#amount").val("");
        $("input[name=inner_order_id]").val('');
        $("input[name=inner_order]").val('');
        $(".input_inner_order_id").html('');
        $(".input_inner_order").html('');
        $("#accountShowDiv").css({
            top: ($(window).height() - $("#accountShowDiv").outerHeight()) / 3
            //, top: ($(window).height() - $("#accountShowDiv").outerHeight()) / 3 + 350
        });
        $("#accountShowDiv").css("display", "block");
    }
    function SetMask() {
        $("#fromTime").setMask({ "mask": "24:59" });
        $("#toTime").setMask({ "mask": "24:59" });
    }
    // class : 금액 합계를 위한 구분자
    function SetGlobalValues() {
        GlobalValue.TravelClass = "travel";
        GlobalValue.InviteClass = "invite";
        GlobalValue.DayAmountClass = "dayAmount";
//GlobalValue.TrainCode = "53120080";
//GlobalValue.PlaneCode = "53120080";
//GlobalValue.TaxiCode = "53120080";
//GlobalValue.InviteCode = "53120090";
//GlobalValue.SleepCode = "53120080";
//GlobalValue.DayAmountCode = "53120080";
//GlobalValue.OfficeCode = "53120250";
        GlobalName.CTrainCode = "差旅费-交通费-火车/Travel-Train";
        GlobalValue.CTrainCode = "53120080";
        GlobalName.CPlaneCode = "差旅费-交通费-飞机/Travel-Aircraft";
        GlobalValue.CPlaneCode = "53120080";
        GlobalName.CTaxiCode = "差旅费-交通费-其他/Travel-Others";
        GlobalValue.CTaxiCode = "53120080";
        GlobalName.CGuoLuFeiCode = "差旅费-过路费/Travel-Tolls";
        GlobalValue.CGuoLuFeiCode = "53120080";
        GlobalName.CTingCheFeiCode = "差旅费-停车费/Travel-Parking fees";
        GlobalValue.CTingCheFeiCode = "53120080";
        GlobalName.CQiYouFeiCode = "差旅费-汽油费/Travel-Petrol";
        GlobalValue.CQiYouFeiCode = "53120080";
        GlobalName.CZhuSuFeiCode = "差旅费-住宿费/Travel-Hotel fees";
        GlobalValue.CZhuSuFeiCode = "53120080";
        GlobalName.CCanYingFeiCode = "差旅费-餐饮费/Travel-Meals fee";
        GlobalValue.CCanYingFeiCode = "53120080";
        GlobalName.ZhaoPingFeiCode = "招聘费用/Recruitment Expense";
        GlobalValue.ZhaoPingFeiCode = "53120010";
        GlobalName.PeiXunFeiCode = "培训费/Training Expense";
        GlobalValue.PeiXunFeiCode = "53120030";
        GlobalName.LaoBaoFeiCode = "劳保用品费/Labor Protection Expense";
        GlobalValue.LaoBaoFeiCode = "53120040";
        GlobalName.YeWuFeiCode = "业务招待费/Entertainment";
        GlobalValue.YeWuFeiCode = "53120090";
        GlobalName.HuiWuFeiCode = "会务费/Conference Expenses";
        GlobalValue.HuiWuFeiCode = "53120100";
        GlobalName.ZuLinFeiCode = "租赁费(宿舍办公室)/Rent/Factory&Office";
        GlobalValue.ZuLinFeiCode = "53120110";
        GlobalName.BanGoneFeiCode = "办公费/Office Expense";
        GlobalValue.BanGoneFeiCode = "53120250";
        GlobalName.KuaiDiFeiCode = "物流费-其他/Logistic expense-others";
        GlobalValue.KuaiDiFeiCode = "53120373";
//GlobalName.KuaiDiFeiCode = "邮费、快递费/Postage&Express";
//GlobalValue.KuaiDiFeiCode = "53120360";
        GlobalName.JinChuFeiCode = "进出口相关费用(销售)/Import&Export/Sales";
        GlobalValue.JinChuFeiCode = "53120371";
        GlobalName.FuLiFeiCode = "福利费/Welfare Expense";
        GlobalValue.FuLiFeiCode = "52110110";
        GlobalName.ShouJiFeiCode = "手机费/Mobile Phone Fee";
        GlobalValue.ShouJiFeiCode = "53120190";
        GlobalName.CheLiangShiYongFeiCode = "小车费/车辆使用费/Car/Usage";
        GlobalValue.CheLiangShiYongFeiCode = "53120050";
        /*
                GlobalName.CheLiangWeiHuFeiCode = "小车费/车辆维护费";
        GlobalValue.CheLiangWeiHuFeiCode = "53120060";
        */
        GlobalName.YingJiaoShuiFeiCode = "应交税费/进项税额/TAX";
        GlobalValue.YingJiaoShuiFeiCode = "21540010";
        GlobalName.CaiWuFeiCode = "财务费用/手续费/Finance Expense/Service Fee";
        GlobalValue.CaiWuFeiCode = "62112010";
        GlobalName.XiaoShouCode = "销售推广费/Sales Promotion";
        GlobalValue.XiaoShouCode = "53120480";
        GlobalName.WorkMealCode = "工作餐/Working meal";
        GlobalValue.WorkMealCode = "53120071";
        GlobalName.TransportCode = "交通费/Transportation";
        GlobalValue.TransportCode = "53120081";
        GlobalName.OvertimeMealAndTransportCode = "加班餐费及交通费/Overtime meal and transportation";
        GlobalValue.OvertimeMealAndTransportCode = "53120082";
        GlobalName.LCExpensesCode = "信用证费用/LC expenses";
        GlobalValue.LCExpensesCode = "53120760";
        GlobalName.TruckCostCode = "卡车/叉车费用/Truck cost";
        GlobalValue.TruckCostCode = "53120052";
        GlobalName.TranslationCode = "翻译费/Translation";
        GlobalValue.TranslationCode = "53120790";
        GlobalName.BiddingExpenseCode = "投标费用/Bidding expense";
        GlobalValue.BiddingExpenseCode = "53120800";
        GlobalName.BusExpenseCode = "员工班车费用/Employee Shuttle bus";
        GlobalValue.BusExpenseCode = "53120051";
        GlobalName.SuSheCode = "员工宿舍费用/Domitory expense";
        GlobalValue.SuSheCode = "52110111";
        GlobalName.GcxmCode = "工程项目专项报销";
        GlobalValue.GcxmCode = "53120440";
        GlobalName.AUCCode = "在建工程/费用/AUC/Expense";
        GlobalValue.AUCCode = "53120610";
        GlobalName.ACCCode = "应付职工薪酬/基本养老保险费";
        GlobalValue.ACCCode = "21520030";
        GlobalName.ConsultingFee = "Consulting Fee";
        GlobalValue.ConsultingFee = "53120220";
        GlobalName.ExhibitionFee = "展览费用/Exhibition Fee";
        GlobalValue.ExhibitionFee = "53120450";
        GlobalName.PromotionExpense = "推广赞助/Promotion Expense";
        GlobalValue.PromotionExpense = "53120451";
        GlobalName.AdvertisingExpense = "广告费/Advertising Expense";
        GlobalValue.AdvertisingExpense = "53120460";
        GlobalName.OtherMarketingExpense = "其他市场费用/Other Marketing Expense";
        GlobalValue.OtherMarketingExpense = "53120470";
        GlobalName.SalesPromotion = "销售推广费/Sales Promotion";
        GlobalValue.SalesPromotion = "53120480";
        GlobalName.MaintenancePower = "一般维护费/动力设备维修/Maintenance/Power Equipment";
        GlobalValue.MaintenancePower = "53120162";
        GlobalName.QingjieLvhua = "清洁/绿化费用";
        GlobalValue.QingjieLvhua = "53120120";
        GlobalName.MaintenanceOther = "一般维护费/其他";
        GlobalValue.MaintenanceOther = "53120164";
        GlobalName.ItWeixiu = "一般维修费/IT维护";
        GlobalValue.ItWeixiu = "53120163";
        GlobalName.ItHaocai = "IT耗材";
        GlobalValue.ItHaocai = "53120560";
        GlobalName.ZuJing = "租金/其他(不含房屋)";
        GlobalValue.ZuJing = "53120170";
        GlobalName.ZiXunGuWen = "咨询顾问费";
        GlobalValue.ZiXunGuWen = "53120220";
        GlobalName.ShuiJinFuJia = "税金及附加";
        GlobalValue.ShuiJinFuJia = "42118020";
        GlobalName.JiangJin = "应付员工薪酬-奖金科目";
        GlobalValue.JiangJin = "21520020";
        GlobalName.MaintenanceBuilding = "一般维护费/房屋及建筑物维修";
        GlobalValue.MaintenanceBuilding = "53120160";
        GlobalName.MaintenancePlant = "Maintenance/Plant&Machinery";
        GlobalValue.MaintenancePlant = "53120161";
        GlobalName.BusinessElse = "其他业务收入";
        GlobalValue.BusinessElse = "41210010";
        GlobalName.BusinessOtherZhichu = "其他业务成本";
        GlobalValue.BusinessOtherZhichu = "42410010";
//GlobalName.InviteCode = "业务招待费";
//GlobalName.SleepCode = "住宿费";
//GlobalName.DayAmountCode = "出差补贴";
        GlobalName.Communication = "Communication";
        GlobalValue.Communication = "53120200";
//GlobalName.OfficeCode = "办公费用";
        GlobalName.Canteen = "员工餐费（食堂）";
        GlobalValue.Canteen = "53120070";
        GlobalName.Dizhi = "物料消耗/低值易耗品";
        GlobalValue.Dizhi = "53120260";
        GlobalName.JianCeFei = "检测费/Inspection Fee";
        GlobalValue.JianCeFei = "53120281";
        GlobalName.CeShiFei = "测试费/test expense";
        GlobalValue.CeShiFei = "53120280";
        GlobalName.KuaiDiFeiCodeA = "邮费、快递费(上海专用)/Postage&Express";
        GlobalValue.KuaiDiFeiCodeA = "53120360";
        GlobalName.Insurance = "保险费/Insurance Expense";
        GlobalValue.Insurance = "53120380";
        GlobalName.Software = "软件/Software";
        GlobalValue.Software = "53120180";
        DefaultRowDeleted = false;
    }
    function DeleteSumAmount() {
        $("#TbItem_del").click();
        SumAmount();
//var data = {
        //'value': parseFloat($('input[name="reportTotal"]').val().replace(/,/g, ''))
        //};
//changeFlow(data);
    }
    function DeleteTravelSumAmount() {
        $("#TbTravel_del").click();
    }
    function SetTravelSelectBox() {
        $("select[name=accountType]")
            .children().remove().end()
            .append("<option selected value=\"" + GlobalValue.CTrainCode + "\" >" + GlobalName.CTrainCode + "</option>")
            .append("<option value=\"" + GlobalValue.CPlaneCode + "\" >" + GlobalName.CPlaneCode + "</option>")
            .append("<option value=\"" + GlobalValue.CTaxiCode + "\" >" + GlobalName.CTaxiCode + "</option>")
            .append("<option value=\"" + GlobalValue.CGuoLuFeiCode + "\">" + GlobalName.CGuoLuFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.CTingCheFeiCode + "\">" + GlobalName.CTingCheFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.CQiYouFeiCode + "\">" + GlobalName.CQiYouFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.CZhuSuFeiCode + "\">" + GlobalName.CZhuSuFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.CCanYingFeiCode + "\">" + GlobalName.CCanYingFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.ZhaoPingFeiCode + "\">" + GlobalName.ZhaoPingFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.PeiXunFeiCode + "\">" + GlobalName.PeiXunFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.LaoBaoFeiCode + "\">" + GlobalName.LaoBaoFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.YeWuFeiCode + "\">" + GlobalName.YeWuFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.HuiWuFeiCode + "\">" + GlobalName.HuiWuFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.ZuLinFeiCode + "\">" + GlobalName.ZuLinFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.BanGoneFeiCode + "\">" + GlobalName.BanGoneFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.KuaiDiFeiCode + "\">" + GlobalName.KuaiDiFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.JinChuFeiCode + "\">" + GlobalName.JinChuFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.FuLiFeiCode + "\">" + GlobalName.FuLiFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.ShouJiFeiCode + "\">" + GlobalName.ShouJiFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.CheLiangShiYongFeiCode + "\">" + GlobalName.CheLiangShiYongFeiCode + "</option>")
            //.append("<option value=\""+ GlobalValue.CheLiangWeiHuFeiCode +"\">"+GlobalName.CheLiangWeiHuFeiCode+"</option>")
            .append("<option value=\"" + GlobalValue.YingJiaoShuiFeiCode + "\">" + GlobalName.YingJiaoShuiFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.CaiWuFeiCode + "\">" + GlobalName.CaiWuFeiCode + "</option>")
            .append("<option value=\"" + GlobalValue.XiaoShouCode + "\">" + GlobalName.XiaoShouCode + "</option>")
            .append("<option value=\"" + GlobalValue.WorkMealCode + "\">" + GlobalName.WorkMealCode + "</option>")
            .append("<option value=\"" + GlobalValue.TransportCode + "\">" + GlobalName.TransportCode + "</option>")
            .append("<option value=\"" + GlobalValue.OvertimeMealAndTransportCode + "\">" + GlobalName.OvertimeMealAndTransportCode + "</option>")
            .append("<option value=\"" + GlobalValue.LCExpensesCode + "\">" + GlobalName.LCExpensesCode + "</option>")
            .append("<option value=\"" + GlobalValue.TruckCostCode + "\">" + GlobalName.TruckCostCode + "</option>")
            .append("<option value=\"" + GlobalValue.TranslationCode + "\">" + GlobalName.TranslationCode + "</option>")
            .append("<option value=\"" + GlobalValue.BiddingExpenseCode + "\">" + GlobalName.BiddingExpenseCode + "</option>")
            .append("<option value=\"" + GlobalValue.BusExpenseCode + "\">" + GlobalName.BusExpenseCode + "</option>")
            .append("<option value=\"" + GlobalValue.SuSheCode + "\">" + GlobalName.SuSheCode + "</option>")
            .append("<option value=\"" + GlobalValue.GcxmCode + "\">" + GlobalName.GcxmCode + "</option>")
            .append("<option value=\"" + GlobalValue.AUCCode + "\">" + GlobalName.AUCCode + "</option>")
            .append("<option value=\"" + GlobalValue.ACCCode + "\">" + GlobalName.ACCCode + "</option>")
            .append("<option value=\"" + GlobalValue.ConsultingFee + "\">" + GlobalName.ConsultingFee + "</option>")
            .append("<option value=\"" + GlobalValue.ExhibitionFee + "\">" + GlobalName.ExhibitionFee + "</option>")
            .append("<option value=\"" + GlobalValue.PromotionExpense + "\">" + GlobalName.PromotionExpense + "</option>")
            .append("<option value=\"" + GlobalValue.AdvertisingExpense + "\">" + GlobalName.AdvertisingExpense + "</option>")
            .append("<option value=\"" + GlobalValue.OtherMarketingExpense + "\">" + GlobalName.OtherMarketingExpense + "</option>")
            .append("<option value=\"" + GlobalValue.SalesPromotion + "\">" + GlobalName.SalesPromotion + "</option>")
            .append("<option value=\"" + GlobalValue.MaintenancePower + "\">" + GlobalName.MaintenancePower + "</option>")
            .append("<option value=\"" + GlobalValue.QingjieLvhua + "\">" + GlobalName.QingjieLvhua + "</option>")
            .append("<option value=\"" + GlobalValue.MaintenanceOther + "\">" + GlobalName.MaintenanceOther + "</option>")
            .append("<option value=\"" + GlobalValue.ItWeixiu + "\">" + GlobalName.ItWeixiu + "</option>")
            .append("<option value=\"" + GlobalValue.ItHaocai + "\">" + GlobalName.ItHaocai + "</option>")
            .append("<option value=\"" + GlobalValue.ZuJing + "\">" + GlobalName.ZuJing + "</option>")
            .append("<option value=\"" + GlobalValue.ZiXunGuWen + "\">" + GlobalName.ZiXunGuWen + "</option>")
            .append("<option value=\"" + GlobalValue.JiangJin + "\">" + GlobalName.JiangJin + "</option>")
            .append("<option value=\"" + GlobalValue.MaintenanceBuilding + "\">" + GlobalName.MaintenanceBuilding + "</option>")
            .append("<option value=\"" + GlobalValue.MaintenancePlant + "\">" + GlobalName.MaintenancePlant + "</option>")
            .append("<option value=\"" + GlobalValue.BusinessElse + "\">" + GlobalName.BusinessElse + "</option>")
            .append("<option value=\"" + GlobalValue.BusinessOtherZhichu + "\">" + GlobalName.BusinessOtherZhichu + "</option>")
            .append("<option value=\"" + GlobalValue.Communication + "\">" + GlobalName.Communication + "</option>")
            .append("<option value=\"" + GlobalValue.Canteen + "\">" + GlobalName.Canteen + "</option>")
            .append("<option value=\"" + GlobalValue.JianCeFei + "\">" + GlobalName.JianCeFei + "</option>")
            .append("<option value=\"" + GlobalValue.CeShiFei + "\">" + GlobalName.CeShiFei + "</option>")
            .append("<option value=\"" + GlobalValue.KuaiDiFeiCodeA + "\">" + GlobalName.KuaiDiFeiCodeA + "</option>")
            .append("<option value=\"" + GlobalValue.Insurance + "\">" + GlobalName.Insurance + "</option>")
            .append("<option value=\"" + GlobalValue.Software + "\">" + GlobalName.Software + "</option>")
            .append("<option value=\"" + GlobalValue.Dizhi + "\">" + GlobalName.Dizhi + "</option>")
        ;
    }
    function SetCurrencySelectBox() {
        if ($("input[name=COMPANY_CODE]").val() == "1060") {
            $("select[name=Currency]")
                .children().remove().end()
                //.css("width","90%")
                .width("148px")
                .append("<option selected value=\"CNY\">[CNY]人民币</option>")
                .append("<option  value=\"AUD\">[AUD]澳元</option>")
                .append("<option  value=\"CHF\">[CHF]瑞士法郎</option>")
                .append("<option  value=\"CAD\">[CAD]加元</option>")
                .append("<option  value=\"EUR\">[EUR]欧元</option>")
                .append("<option  value=\"GBP\">[GBP]英镑</option>")
                .append("<option  value=\"HKD\">[HKD]港元</option>")
                .append("<option  value=\"JPY\">[JPY]日元</option>")
                .append("<option  value=\"KRW\">[KRW]韩元</option>")
                .append("<option  value=\"USD\">[USD]美元</option>");
        } else {
            $("select[name=Currency]")
                .children().remove().end()
                //.css("width","90%")
                .width("148px")
                .append("<option selected value=\"CNY\" selected>[CNY]人民币</option>");
        }
        // companyCode, userId
        var companyCode = $("input[name=COMPANY_CODE]").val();
        var userId = $("input[name=staffCode]").val();
//alert( "company = " + companyCode + " userid=" + userId);
        if (userId != "" && companyCode != "") {
            CallWebService(userId, companyCode);
        } else {
            alert("User Information Error");
            return false;
        }
    }
    function AddAccount() {
        if (accountInputDivValid() == false) {
            return false;
        }
        $("#TbItem_add").click();
        AddInfo();
        DeleteDefaultRow();
        SumAmount();
    }
    function SumAmount() {
        var totalsum = 0;
        var shuisum = 0;
        var weishuisum = 0
        var amount = 0;
        $("#TbItem tr.addedTr").each(function (index) {
            if (index > 0) {// skip first tr row. (this is dummy)
                amount = 0;
                if (replaceAll($(this).find("input[name=mAmount]").val(), ",", "") != "") {
                    amount = parseFloat(replaceAll($(this).find("input[name=mAmount]").val(), ",", ""));
                }
                var accountType = $(this).find("#mAccountType").val();
                if (accountType == GlobalName.YingJiaoShuiFeiCode) {
                    shuisum = parseFloat(shuisum) + amount;
                } else {
                    weishuisum = parseFloat(weishuisum) + amount;
                }
                totalsum = parseFloat(totalsum) + amount;
            }
        });
        var subTotal = "";
        if (shuisum > 0) {
            subTotal = "金额：" + weishuisum.toFixed(2) + "，税额：" + shuisum.toFixed(2) + "，总计：" + totalsum.toFixed(2);
        } else {
            subTotal += " 总计： " + totalsum.toFixed(2);
        }
        $("#subTotal").val(subTotal);
        $("#subTotal_span").html(subTotal);
//$("#reportTotal").val((totalsum-dayAmountSum).toFixed(2));
//$("#reportTotal_span").html((totalsum-dayAmountSum).toFixed(2));
        $("#reportTotal").val((totalsum).toFixed(2));
        $("#reportTotal_span").html((totalsum).toFixed(2));
        $("#dueToAmount").val((totalsum).toFixed(2));
        $("#dueToAmount_span").html((totalsum).toFixed(2));
        $("#returnAmount").val("0");
        $("#returnAmount_span").html("0");
//根据用户反馈，去掉了默认冲销预支金额
        //if( parseFloat($("#reportTotal").val())> parseFloat($("#cashAmount").val()) ) {
        //var dueToAmount = (parseFloat($("#reportTotal").val()) - parseFloat($("#cashAmount").val())).toFixed(2);
//var returnAmount = parseFloat($("#cashAmount").val()).toFixed(2);
//$("#dueToAmount").val(dueToAmount);
//$("#dueToAmount_span").html(dueToAmount);
//$("#returnAmount").val(returnAmount);
//$("#returnAmount_span").html(returnAmount);
//} else {
        //var returnAmount = parseFloat($("#reportTotal").val()).toFixed(2);
//$("#dueToAmount").val("0.00");
//$("#dueToAmount_span").html("0.00");
//$("#returnAmount").val(returnAmount);
//$("#returnAmount_span").html(returnAmount);
//}
    }
    function AddInfo() {
        var accountType = $("select[name=accountType]").val();
        var accountTypeName = $("select[name=accountType]").find("option:selected").text();
        var CostCode = $.trim($("#CC_CODE").val());
        var aufnrName = $.trim($("input[name='inner_order']").val());
        var aufnr = $.trim($("#inner_order_id").val());
        var happenDate = $.trim($("#happenDate").val());
        var startDate = $.trim($("#StartDate1").val());
        var month = $("select[name=Month]").find("option:selected").text();
        var endDate = $.trim($("#EndDate1").val());
        var days = $.trim(replaceAll($("#Term1").val(), ",", ""));
        var nights = $.trim($("#Term2").val());
        var entertain = $.trim($("#entertain").val());
        var location = $.trim($("#location").val());
        var startLocation = $.trim($("#startLocation").val());
        var endLocation = $.trim($("#endLocation").val());
        var hotelName = $.trim($("#hotelName").val());
        var daySubsidy = $.trim(replaceAll($("#daySubsidy").val(), ",", ""));
        var amount = $.trim(replaceAll($("#amount").val(), ",", ""));
        var remark = $.trim($("#remark").val());
        var Budget = $.trim($("input[name=budget]:checked").val());
        var mAccountType = accountTypeName;
        var mCostCode = CostCode;
        var mDate = "";
        var mAmount = parseFloat(amount).toFixed(2);
        var mRemark = "";
        if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CTrainCode) {
            mDate = startDate + "~" + endDate + "(" + days + "天" + nights + "夜)";
            mRemark = "" + startLocation + "到" + endLocation + "，" + remark;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CPlaneCode) {
            mDate = happenDate;
            mRemark = "" + startLocation + "到" + endLocation + "，" + remark;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CTaxiCode) {
            mDate = happenDate;
            mRemark = "" + remark;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.YeWuFeiCode) {
            mDate = happenDate;
            mRemark = "招待人数：" + entertain + "，" + remark;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CZhuSuFeiCode) {
            mDate = startDate + "~" + endDate + "(" + days + "天" + nights + "夜)";
            mRemark = "" + hotelName + "，" + remark;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CCanYingFeiCode) {
            mDate = startDate + "~" + endDate + "(" + days + "天" + nights + "夜)";
            mRemark = "" + location + "，" + remark;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.ShouJiFeiCode) {
            mDate = month;
            mRemark = "" + remark;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.GcxmCode) {
            //alert(aufnrName);
            mDate = happenDate;
            mRemark = aufnr + ", " + aufnrName + ", " + remark;
        } else {
            mDate = happenDate;
            mRemark = "" + remark;
        }
        $tr = $('#TbItem .addedTr:last');
        $tr.find("input[name=mAccountType]").val(mAccountType);
        $tr.find("#mAccountType_span").html(mAccountType);
        $tr.find("input[name=mCostCode]").val(mCostCode);
        $tr.find("#mCostCode_span").html(mCostCode);
        $tr.find("#businessCode").val(accountType);
        $tr.find("input[name=mDate]").val(mDate);
        $tr.find("#mDate_span").html(mDate);
        $tr.find("input[name=mAmount]").val(mAmount);
        $tr.find("#mAmount_span").html(mAmount);
        $tr.find("input[name=mRemark]").val(mRemark);
        $tr.find("#mRemark_span").html(mRemark);
        $tr.find("input[name=mBudget]").val(Budget);
        $tr.find("#mBudget_span").html(Budget);
        $tr.find("input[name='aufnr']").val(aufnr);
    }
    function searchCostCenter(tagId) {
        var inputDiv = $(".input_" + tagId);
        var imgDiv = $(".img_" + tagId);
        $(imgDiv).click(function (event) {
            $objTr = $(this).closest("tr");
// 이미지 클릭시 바로 팝업을 띄운다.
            // isGroupYn = "N" 은 왼쪽 tree를 안띄우는 옵션
            var strWhere = " and VENDOR_CODE = " + $("input[name=COMPANY_CODE]").val() + " ";
            var strOrderBy = " order by CC_CODE ";
            $.modal({
                url: "/neo/modules/approval/sta/staSelectMain.mvc",
                title: "选择数据(기준데이타 선택)",
                param: {
                    "folderId": "881",
                    "isGroupYn": "N",
                    "strWhere": strWhere,
                    "strOrderBy": strOrderBy
                },
                width: 800,
                height: 550,
                scroll: "no",
                onClose: function (jsonObj) {
                    if (jsonObj != null) {
                        var companyCode = $("input[name=COMPANY_CODE]").val();
                        if (typeof (companyCode) != "undefined" && companyCode != "") {
                            if (jsonObj.VENDOR_CODE != companyCode) {
                                alert("Cost Center & Company Code is not match");
                                return false;
                            }
                        }
                        // hidden 에 data 셋팅
                        $("input[name=CC_CODE]").val(jsonObj.CC_CODE);
                        $("input[name=CC_NAME]").val(jsonObj.CC_NAME);
// 실제 화면에 보여지는 data 셋팅
                        $(".input_CC_CODE").html(jsonObj.CC_CODE);
                        $(".input_CC_NAME").html(jsonObj.CC_NAME);
                    }
                }
            });
//$objTr.find(".input_" + tagId).html("aaa") ;
        });
    }
    function searchCompanyCode(tagId) {
        var inputDiv = $(".input_" + tagId);
        var imgDiv = $(".img_" + tagId);
        $(imgDiv).click(function (event) {
            $objTr = $(this).closest("tr");
// 이미지 클릭시 바로 팝업을 띄운다.
            // isGroupYn = "N" 은 왼쪽 tree를 안띄우는 옵션
            $.modal({
                url: "/neo/modules/approval/sta/staSelectMain.mvc",
                title: "기준데이타 선택",
                param: { "folderId": "2413", "isGroupYn": "N" },
                width: 800,
                height: 550,
                scroll: "no",
                onClose: function (jsonObj) {
                    if (jsonObj != null) {
                        // hidden 에 data 셋팅
                        $("input[name=COMPANY_CODE]").val(jsonObj.COMPANY_CODE);
// 실제 화면에 보여지는 data 셋팅
                        $(".input_COMPANY_CODE").html(jsonObj.COMPANY_CODE);
// Clear Cost Center
                        $("input[name=CC_CODE]").val("");
                        $("input[name=CC_NAME]").val("");
// 실제 화면에 보여지는 data 셋팅
                        $(".input_CC_CODE").html("");
                        $(".input_CC_NAME").html("");
                        SetCurrencySelectBox();
                    }
                }
            });
//$objTr.find(".input_" + tagId).html("aaa") ;
        });
    }
    //内部订单
    function searchInternalOrder(tagId) {
        var inputDiv = $(".input_" + tagId);
        var imgDiv = $(".img_" + tagId);
        $(imgDiv).click(function (event) {
            $objTr = $(this).closest("tr");
// 이미지 클릭시 바로 팝업을 띄운다.
            // isGroupYn = "N" 은 왼쪽 tree를 안띄우는 옵션
            var strWhere = " and COMPANY_CODE = " + $("input[name=COMPANY_CODE]").val() + " ";
            var strOrderBy = " order by INNER_ORDER ";
            $.modal({
                url: "/neo/modules/approval/sta/staSelectMain.mvc",
                title: "选择数据(기준데이타 선택)",
                param: {
                    "folderId": "887",
                    "isGroupYn": "N",
                    "strWhere": strWhere,
                    "strOrderBy": strOrderBy
                },
                width: 800,
                height: 550,
                scroll: "no",
                onClose: function (jsonObj) {
                    if (jsonObj != null) {
                        // hidden 에 data 셋팅
                        $("input[name=inner_order_id]").val(jsonObj.INNER_ORDER);
                        $("input[name=inner_order]").val(jsonObj.ORDER_DES);
// 실제 화면에 보여지는 data 셋팅
                        $(".input_inner_order_id").html(jsonObj.INNER_ORDER);
                        $(".input_inner_order").html(jsonObj.ORDER_DES);
                    }
                }
            });
//$objTr.find(".input_" + tagId).html("aaa") ;
        });
    }
    function addZero(n) {
        return n < 10 ? "0" + n : n;
    }
    function stdDateCheck() {
        var stdStr = $('#StartDate1').val();
        var endStr = $('#EndDate1').val();
        var stdDate = stdStr.split("-");
        var cur_year = addZero(stdDate[0]);
        var cur_month = addZero(stdDate[1]);
        var cur_date = addZero(stdDate[2]);
        var stdDate1 = new Date(cur_year, cur_month - 1, cur_date).valueOf();
        var endDate1 = "";
        if (endStr != '') {
            var endDate = endStr.split("-");
            var end_year = addZero(endDate[0]);
            var end_month = addZero(endDate[1]);
            var end_date = addZero(endDate[2]);
            endDate1 = new Date(end_year, end_month - 1, end_date).valueOf();
            if (endDate1 - stdDate1 < 0) {
                alert('起始日期不能大于终止日期');
                $("#stdDate").val("");
                return;
            }
            var duration = (endDate1 - stdDate1) / (1000 * 60 * 60 * 24);
            $("#Term1").val(duration + 1);
            $("#Term2").val(duration);
            if ($("select[name=accountType]").find("option:selected").text() == GlobalName.DayAmountCode) {
                $("#amount").val(parseFloat(replaceAll($("#daySubsidy").val(), ",", "")) * parseFloat($("#Term1").val()));
            }
        }
    }
    function ednDateCheck() {
        var stdStr = $('#StartDate1').val();
        var endStr = $('#EndDate1').val();
        var stdDate1 = "";
        var endDate1 = "";
        var endDate = endStr.split("-");
        var end_year = addZero(endDate[0]);
        var end_month = addZero(endDate[1]);
        var end_date = addZero(endDate[2]);
        endDate1 = new Date(end_year, end_month - 1, end_date).valueOf();
        if (stdStr != '') {
            var stdDate = stdStr.split("-");
            var cur_year = addZero(stdDate[0]);
            var cur_month = addZero(stdDate[1]);
            var cur_date = addZero(stdDate[2]);
            stdDate1 = new Date(cur_year, cur_month - 1, cur_date).valueOf();
            if (endDate1 - stdDate1 < 0) {
                alert('终止日期必须小于起始日期');
                $("#endDate").val("");
                return;
            }
            var duration = (endDate1 - stdDate1) / (1000 * 60 * 60 * 24);
            $("#Term1").val(duration + 1);
            $("#Term2").val(duration);if ($("select[name=accountType]").find("option:selected").text() == GlobalName.DayAmountCode) {                $("#amount").val(parseFloat(replaceAll($("#daySubsidy").val(), ",", "")) * parseFloat($("#Term1").val()));}        }    }    function callbk() {        var orgJson = $('#StaffName').val();if (typeof (orgJson) != "undefined") {            var jsonArray = $.evalJSON(orgJson);if (jsonArray.length > 0) {
        var userId = jsonArray[0].userId;
        var employeeNo = jsonArray[0].employeeNo;
        var deptName = jsonArray[0].deptName;
        var position = jsonArray[0].jobPositionName;
        var companyCode = jsonArray[0].companyCode;
        var ccCode = jsonArray[0].ccCode;
        if ("C0001" == companyCode || "B01" == companyCode) {// qidong
            companyCode = "1010";
        } else if ("C0002" == companyCode || "B02" == companyCode) {// sanghai
            companyCode = "1010";
        } else if ("C0004" == companyCode) {// nantong
            companyCode = "1030";
        } else if ("C0005" == companyCode || "C01" == companyCode) {// LYG
            companyCode = "1040";
        } else if ("C0009" == companyCode || "A01" == companyCode) {//
            companyCode = "1020";
        } else {
            companyCode = "1010";
        }
        //如果已经有公司代码，则不改变
        companyCode = $("input[name=COMPANY_CODE]").val() == "" ? companyCode : $("input[name=COMPANY_CODE]").val();
// HR data validation Check
        //if(typeof(ccCode) != "undefined" && ccCode != ""){
        //if(ccCode.length == 9){
        //companyCode = ccCode.substr(0, 4);
//}
        //}
        $('#staffCode').val(userId);
        $('#DeptName').val(deptName);
        $('#position').val(position);
        $(".input_COMPANY_CODE").html(companyCode);
        $("input[name=COMPANY_CODE]").val(companyCode);
        $(".input_CC_NAME").html(ccCode);
        $("input[name=CC_NAME]").val(ccCode);
        $(".input_CC_CODE").html(ccCode);
        $("input[name=CC_CODE]").val(ccCode);
//设定是否默然现金报销
        //高扬  2871，PAUL1269 ,，陈文杰6618，陈文浚7033 ，许红伟0005 ，陆彩红0008 ，姚向前0018 ，盛健华0163 ，CFO(中文你找一下）90003 ，
        //蒋驰30335 ，陈雪成2012030935 ，姜雨生  0390 ，奚君30254 ，柴敬玉28888 ，张建平2011110012
        //李钟赫90048 ，李钟鹤90043  ，申镐宇90009 ，金恩植90014 ，李在彬90017 ，金成熏90035 ，
        var arrayUser = ['2011110012', '30254'];
        var userCheckFlag = false;
        for (var j = 0;
             j < arrayUser.length;
             j++) {
            if (userId == arrayUser[j]) {
                userCheckFlag = true;
                break;
            }
        }
        if (userCheckFlag) {
            $('#Payment').attr('value', '1');
//$('#').selectedIndex = 0;
//alert(userCheckFlag);
        } else {
            $('#Payment').attr('value', '2');
//$('#Payment').selectedIndex = 1;
        }
        // companyCode, userId
        if (userId != "" && companyCode != "") {
            CallWebService(userId, companyCode);
        } else {
            alert("请手动选择公司代码.");
            return false;
        }
    }
    }
    }
    function IsSpace(obj, type, msg) {
        if ($.trim($(obj).val()) == '') {
            //alert('Insert '+ msg +' Data ...');
            alert(msg + ' 不能为空！');
            if (type == 'input')//input type일경우
            {
                $(obj).select();
            }
            $(obj).focus();
            return true;
        }
    } //end of function
    function accountInputDivValid() {
        if (IsSpace($('input[name="CC_CODE"]'), 'input', '成本中心')) return false;
        if ($("select[name=accountType]").find("option:selected").text() == GlobalName.TaxiCode) {
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.PlaneCode) {
            if (IsSpace($('input[name="startLocation"]'), 'input', '出发地')) return false;
            if (IsSpace($('input[name="endLocation"]'), 'input', '目的地')) return false;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.TrainCode) {
            if (IsSpace($('input[name="startLocation"]'), 'input', '出发地')) return false;
            if (IsSpace($('input[name="endLocation"]'), 'input', '目的地')) return false;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.InviteCode) {
            if (IsSpace($('input[name="entertain"]'), 'input', '招待人数')) return false;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.SleepCode) {
            if (IsSpace($('input[name="hotelName"]'), 'input', '酒店名称')) return false;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.DayAmountCode) {
            if (IsSpace($('input[name="location"]'), 'input', '出差地')) return false;
            if (IsSpace($('input[name="daySubsidy"]'), 'input', '日补贴')) return false;
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.GcxmCode) {
            if (IsSpace($('input[name="inner_order_id"]'), 'input', '内部订单')) return false;
            var innerOrderId = $('input[name="inner_order_id"]').val();
            if (innerOrderId.indexOf('P') != 0) {
                alert('内部订单错误！');
                return false;
            }
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.AUCCode) {
            if (IsSpace($('input[name="inner_order_id"]'), 'input', '内部订单')) return false;
            var innerOrderId = $('input[name="inner_order_id"]').val();
            if (innerOrderId.indexOf('3') != 4) {
                alert('内部订单错误！');
                return false;
            }
        }
        if (IsSpace($('input[name="amount"]'), 'input', '金额')) return false;
        if (IsSpace($('input[name="remark"]'), 'input', '备注')) return false;
    }
    function AddTravel() {
        $("#TbTravel_add").click();
    }
    function CallWebService(userId, companyCode) {
        ep.ajax({
            url: "/neo/branch/solarone/ws/getCashAdvanceAmount.mvc",
            data: {
                userId: userId
                , companyCode: companyCode
            },
            dataType: "json",
            callback: function (result) {
                var cashAmount = 0;
                cashAmount = parseFloat(result.cashAmount);
                $("#cashAmount").val(cashAmount.toFixed(2));
                $("#cashAmount_span").html(cashAmount.toFixed(2));
//SumAmount();
            }
        });
    }
    function AccountDivConfirm() {
        AddAccount();
//var data = {
        //'value': parseFloat($('input[name="reportTotal"]').val().replace(/,/g, ''))
        //};
//changeFlow(data);
    }
    function AccountDivCancel() {
        $("#accountShowDiv").css("display", "none");
    }
    function ChangeContents() {
        $(".notice").hide();
        if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CTaxiCode) {
            $(".trStartEndDate").hide();
            $(".trHappenDate").show();
            $(".trMonth").hide();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").hide();$(".trEntertain").hide();$(".trHotelName").hide();$(".trAmount1").show();$(".trAmount2").hide();$("input[name='amount']").removeAttr("readonly");$("#strNote").html("Note：<br>飞机票或火车票请选择相应类型进行填写。");
            $(".trGongchengxiangmu").hide();
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CPlaneCode) {
            $(".trStartEndDate").hide();
            $(".trHappenDate").show();
            $(".trMonth").hide();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").show();
            $(".trEntertain").hide();
            $(".trHotelName").hide();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
            $("#strNote").html("Note：<br>多张飞机票请分次填写。");
            $(".trGongchengxiangmu").hide();
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CTrainCode) {
            $(".trStartEndDate").show();
            $(".trHappenDate").hide();
            $(".trMonth").hide();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").show();
            $(".trEntertain").hide();
            $(".trHotelName").hide();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
            $("#strNote").html("Note：<br>多张火车票请分次填写。");
            $(".trGongchengxiangmu").hide();
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.YeWuFeiCode) {
            $(".trStartEndDate").hide();
            $(".trHappenDate").show();
            $(".trMonth").hide();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").hide();
            $(".trEntertain").show();
            $(".trHotelName").hide();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
//$("#strNote").html("Note：<br>一类城市(120元/人)，二类城市(100元/人)，其他城市(80元/人)");
            $("#strNote").html("");
            $(".trGongchengxiangmu").hide();
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CZhuSuFeiCode) {
            $(".notice").show();
            $(".trStartEndDate").show();
            $(".trHappenDate").hide();
            $(".trMonth").hide();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").hide();
            $(".trEntertain").hide();
            $(".trHotelName").show();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
//$("#strNote").html("Note：<br>一类城市(250元/夜)，二类城市(200元/夜)，其他城市(150元/夜)");
            $("#strNote").html("");
            $(".trGongchengxiangmu").hide();
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CCanYingFeiCode) {
            $(".trStartEndDate").show();
            $(".trHappenDate").hide();
            $(".trMonth").hide();
            $(".trDaySubsidy").show();
            $(".trLocation").show();
            $(".trStartEndLocation").hide();
            $(".trEntertain").hide();
            $(".trHotelName").hide();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
//$("#strNote").html("Note：<br>经理及高级经理：一类城市(200元/天)，二类城市(180元/天)，其他城市(150元/天)<br>其他员工：一类城市(150元/天)，二类城市(120元/天)，其他城市(100元/天)");
            $("#strNote").html("");
//$("#daySubsidy").focusout(function(){
            //$("#amount").val(parseFloat(replaceAll($("#daySubsidy").val(),",",""))*parseFloat($("#Term1").val()));
//});
            $(".trGongchengxiangmu").hide();
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.ShouJiFeiCode) {
            $(".trStartEndDate").hide();
            $(".trHappenDate").hide();
            $(".trMonth").show();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").hide();
            $(".trEntertain").hide();
            $(".trHotelName").hide();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
            $("#strNote").html("Note：<br>通讯费用报销");
            $(".trGongchengxiangmu").hide();
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.BanGoneFeiCode) {
            $(".trStartEndDate").hide();
            $(".trHappenDate").show();
            $(".trMonth").hide();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").hide();
            $(".trEntertain").hide();
            $(".trHotelName").hide();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
            $("#strNote").html("Note：<br>办公费用报销");
            $(".trGongchengxiangmu").hide();
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.CQiYouFeiCode) {
            $(".trStartEndDate").hide();
            $(".trHappenDate").show();
            $(".trMonth").hide();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").hide();
            $(".trEntertain").hide();
            $(".trHotelName").hide();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
            $("#strNote").html("Note：<br>若是私车公用，请备注说明。");
            $(".trGongchengxiangmu").hide();
        } else if ($("select[name=accountType]").find("option:selected").text() == GlobalName.GcxmCode || $("select[name=accountType]").find("option:selected").text() == GlobalName.AUCCode) {
            $(".trStartEndDate").hide();
            $(".trHappenDate").show();
            $(".trMonth").hide();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").hide();
            $(".trEntertain").hide();
            $(".trHotelName").hide();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
            $("#strNote").html("");
            $(".trGongchengxiangmu").show();
        }
        else {
            $(".trStartEndDate").hide();
            $(".trHappenDate").show();
            $(".trMonth").hide();
            $(".trDaySubsidy").hide();
            $(".trLocation").hide();
            $(".trStartEndLocation").hide();
            $(".trEntertain").hide();
            $(".trHotelName").hide();
            $(".trAmount1").show();
            $(".trAmount2").hide();
            $("input[name='amount']").removeAttr("readonly");
            $("#strNote").html("");
            $(".trGongchengxiangmu").hide();
        }
    }
    function valid_check() {
        //var data = {
        //'value': parseFloat($('input[name="reportTotal"]').val().replace(/,/g, ''))
        //};
//changeFlow(data);
        if ($.trim($('#StaffName').val()) == '[]') {
            alert('员工姓名 不能为空！');
            $('#StaffName').focus()
            return false;
        }
        if ($.trim($('#payeeName').val()) == '') {
            alert('收款人户名 不能为空！');
            $('#payeeName').focus()
            return false;
        }
        if ($.trim($('#payeeAccount').val()) == '') {
            alert('收款人账号 不能为空！');
            $('#payeeAccount').focus()
            return false;
        }
        if ($.trim($('#payeeBank').val()) == '') {
            alert('收款人银行 不能为空！');
            $('#payeeBank').focus()
            return false;
        }
        //公司代码跟成本中心不符不让发起
        var companyCode = $("input[name=COMPANY_CODE]").val();
        if (companyCode == "") {
            alert("请选择公司代码");
            return false;
        }
        $("#TbItem tr.addedTr").each(function (index) {
            if (index > 0) {// skip first tr row. (this is dummy)
                var cc_code = $(this).find("#mCostCode").val();
                if (!cc_code)
                    return true;
                else if (cc_code.indexOf(companyCode) != 0) {
                    flag = false;
                    alert('成本中心和公司代码不符！');
                    $(this).find("#mCostCode").focus();
                    return false;
                }
            }
        });
        var flag = false;
//进行费用预算校验,只有发起的时候进行校验
        if ($('#mode').val() == "write" || $('#mode').val() == "rewriteFromInst" || $('#mode').val() == 'rewrite') {
            ep.ajax({
                url: "/neo/branch/solarone/ws/checkExpenseBudget.mvc",
                async: false,
                data: $('#documentBodyForm').serialize(),
                dataType: "json",
                callback: function (result) {
                    if (result.result == "Y") {
                        flag = true;
                    } else {
                        flag = false;
                        alert("费用预算不足，以下为SAP系统提示信息：\r\n" + result.msg);
                    }
                } //,
                //error:function(xhr, s, e){
                //flag = false;
//alert("SAP预算检查接口出错：\r\n"+e.toString());
//}
            });
        } else {
            flag = true;
        }
        if (!flag) {
            return false;
        }
        //发送SAP检查发票清单
        var invoiceList = $("input[name=invoiceList]").val();
        if (invoiceList.length > 200) {
            alert('电子发票清单不能超过200个字符');
            $('invoiceList').focus()
            return false;
        }
        if (invoiceList != '') {
            ep.ajax({
                url: "/neo/branch/solarone/ws/checkExpenseInvoice.mvc",
                async: false,
                data: $('#documentBodyForm').serialize(),
                dataType: "json",
                callback: function (result) {
                    if (result.result == "Y") {
                        flag = true;
                    } else {
                        flag = false;
                        alert("发票清单信息错误，以下为SAP系统提示信息：\r\n" + result.msg);
                    }
                } //,
                //error:function(xhr, s, e){
                //flag = false;
//alert("SAP发票检查接口出错：\r\n"+e.toString());
//}
            });
        }
        if (!flag) {
            return false;
        }
        return true;
    }
    function PaymentSelect() {
        var Payment = $("select[name=Payment]").val();
        if (Payment == 1) {
            $(".tdBankAccount").hide();
            $(".tdBankAccount1").hide();
            $(".tdBankAccount2").hide();
        } else {
            $(".tdBankAccount").show();
            $(".tdBankAccount1").show();
            $(".tdBankAccount2").show();
        }
    }
    function alertZhu() {
        alert("注:此处填写银行会计科目，发起人无需填写，\r\n   由财务人员进行填写。");
    }
    function changeFlow(p) {
        var defaultData = {
            'wfId': $('#wfId').val()
        }
        var flowParams = $.extend(defaultData, p);
        ep.ajax({
            url: '/neo/modules/approval/wf/getRuntimeWf.mvc',
            data: flowParams,
            dataType: 'json',
            callback: function (data) {
                if (data.result == 'Y') {
                    $('#flowXml').val(data.flow);
                    approvalFlow.loadXMLString($('#flowXml').val());
                    drawAppovalLine(approvalFlow.rootElement, approvalFlow.xmlDocument);
                    return true;
                } else {
                    return false;
                }
            }
        });
    }
    function currencyComma(obj) {
        var currency = $("select[name=Currency]").val();
        if (currency == 'JPY' || currency == 'KRW') {
            comma(obj, 0);
        } else {
            comma(obj, 2);
        }
    }
</script>


<script src="/neo/js/solarone/solarUtil.js" type="text/javascript"></script>


<script language="javascript">
    $(document).ready(function () {
        <c:if test="${doc.write and !doc.modify}">
            callbk();
        </c:if>
        $(".TravelContents").hide();
        $(".notice").hide();
        SetGlobalValues();
        SetMask();
        SetTravelSelectBox();
        ChangeContents();
        setDefault();
        EventUserDelete();
//PaymentSelect();
        if ($("input[name=COMPANY_CODE]").val() != "1060") {
            SetCurrencySelectBox();
        }
    });
</script>


<br>


<table width="100%"><colgroup><col width="312"><col width=""></colgroup>

    <tbody>
    <tr>
        <td class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <p align="left" class="form-logo-qcells">${form_logo}</p>
        </td>
        <td class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <p align="center"><b class="font-cn"><span style="font-size: 16pt;">费用报销单</span></b></p><p align="center"><b><span style="font-size: 16pt;">EXPENSE REIMBURSEMENT APPLICATION</span></b></p>
        </td>
    </tr>
    <tr>
        <td class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <p align="left"><br></p>
        </td>
        <td class="dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <p align="right">
                单号/NO：<input name="문서번호" type="text" value="문서번호"></p>
        </td>
    </tr>
    </tbody>
</table>



<table class="aprvl-table-basic" style="width: 900px;"><colgroup><col width="120"><col width=""></colgroup>

    <tbody>
    <tr class="aprvl-table-row">
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            主 题 <br>
            Theme

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="bodyDocTitle" class="form-txt-width-full" type="text">

        </td>
    </tr>
    </tbody>
</table>



<br>


<table class="aprvl-table-basic"><colgroup><col width="110"><col width="150"><col width="100"><col width="150"><col width="110"><col width=""></colgroup>

    <tbody>
    <tr class="aprvl-table-row">
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            员工姓名<br>
            Staff Name

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <img align="bottom" alt="tag{tagType: orgUser, name: StaffName, width: 145 ,titleHead: SelectStaff, singleSelectYN: Y, callback: callbk}" src="/neo/js/ewt/ext/formEditor/images/user_obj.gif" border="0">

        </td>
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            工 号<br>
            Staff
            Code

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" name="staffCode">
            <input class="form-txt-width-full" type="text">

        </td>
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            部 门<br>Department

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="DeptName" class="form-txt-width-full" type="text">

        </td>
    </tr>
    <tr class="aprvl-table-row">
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            公司代码<br>
            Company
            Code

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="COMPANY_CODE" class="form-txt-width-full" type="text" searchfn="searchCompanyCode('COMPANY_CODE')">

        </td>
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            职 位<br>Position

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="position" class="form-txt-width-full" type="text">

        </td>
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            办公地点<br>Working
            Location

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="workingLocation" class="form-txt-width-full" type="text">

        </td>
    </tr>
    <tr class="aprvl-table-row">
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            支付方式<br>Payment

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="1">
            <font id="incident"><select name="Payment" onchange="PaymentSelect()" size="1"><option selected="selected" value="2">银行支付</option></select></font>
        </td>
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            币 种<br>Currency

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <select name="Currency"><option selected="selected" value="CNY">[CNY]人民币</option><option value="AUD">[AUD]澳元</option><option value="CHF">[CHF]瑞士法郎</option><option value="EUR">[EUR]欧元</option><option value="GBP">[GBP]英镑</option><option value="HKD">[HKD]港元</option><option value="JPY">[JPY]日元</option><option value="KRW">[KRW]韩元</option><option value="USD">[USD]美元</option><option value="CAD">[CAD]加元</option></select>

        </td>
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            联系方式<br>Contact Way

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="1">
            <input name="contactWay" class="form-txt-width-full" type="text">

        </td>
    </tr>
    <tr class="aprvl-table-row">
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            出差申请单<br>Travel Request
        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <img alt="tag{&quot;tagType&quot;: &quot;linkDoc&quot;, &quot;name&quot;: &quot;travelDocument&quot;, &quot;titleHead&quot;: &quot;Link Doc&quot;, &quot;width&quot;: &quot;120&quot;, &quot;callback&quot;: &quot;&quot;}" src="/neo/js/ewt/ext/formEditor/images/i-file-none.gif" border="0">
        </td>
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            FCPA表单<br>FCPA Request
        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <img alt="tag{&quot;tagType&quot;: &quot;linkDoc&quot;, &quot;name&quot;: &quot;fcpaDocument&quot;, &quot;titleHead&quot;: &quot;Link Doc&quot;, &quot;width&quot;: &quot;120&quot;, &quot;callback&quot;: &quot;&quot;}" src="/neo/js/ewt/ext/formEditor/images/i-file-none.gif" border="0">
        </td>
        <td align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <p><br></p>
        </td>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <p><br></p>
        </td>
    </tr>
    <tr class="aprvl-table-row">
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            收款人户名<br>Payee name.

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="1">
            <input name="payeeName" class="form-txt-width-full" type="text">

        </td>
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            收款人账号<br>Payee account.

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="1">
            <input name="payeeAccount" class="form-txt-width-full" type="text">

        </td>
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            收款人开户行<br>Payee bank.

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="1">
            <input name="payeeBank" class="form-txt-width-full" type="text">

        </td>
    </tr>
    <tr class="aprvl-table-row">
        <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            电子发票清单<br>Electronic invoice List

        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" style="-ms-word-break: break-all;" colspan="3">
            <input name="invoiceList" class="form-txt-width-full" type="text">

        </td>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="2">

            发票清单样例：XXXXXXX1/XXXXXXX2 八位数发票号码，使用正斜杠分割,若无电子发票，无需填写

        </td>
    </tr>
    <tr class="aprvl-table-row">
        <th class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">


            备注<br>Remark
        </th>
        <td class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="5">
            <input name="remarkM" class="form-txt-width-full" type="text">
        </td>
    </tr>
    </tbody>
</table>



<c:if test="${doc.write}">
    <div id="accountShowDiv">
        <div id="accountInputDiv" style="width: auto;">

            <table class="aprvl-table-basic"><colgroup><col width="150"><col width=""></colgroup>
                <tbody>
                <tr class="aprvl-table-row">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        费用类别<br>Expense Type

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <select name="accountType" onchange="ChangeContents()" size="1"></select><a class="notice" onclick="javascript: fnAppr4BbsNewPopup('000074668','5815', 'COMPANY');return false;" href="#" target="_blank">填写样例</a>

                    </td>
                </tr>
                <tr class="aprvl-table-row">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        成本中心<br>Cost Center

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <span><input name="CC_NAME" class="cc-name" type="text" searchfn="searchCostCenter('CC_NAME')"><input type="hidden" id="" name="CC_CODE" value="" class="" title=""></span>
                    </td>
                </tr>
                <tr class="aprvl-table-row trGongchengxiangmu">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        内部订单<br>Internal Order

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <span><input name="inner_order" style="border: 1px solid rgb(189, 182, 189); border-image: none; width: 80%; height: 19px; color: rgb(102, 102, 102); overflow: hidden; background-color: rgb(255, 255, 255);" type="text" searchfn="searchInternalOrder('inner_order')"><input type="hidden" id="" name="inner_order_id" value="" class="" title=""></span>
                    </td>
                </tr>
                <tr class="aprvl-table-row">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        预算内(外)<br>within/out budget

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
				<span><input name="budget" type="radio" value="预算内" checked="checked">预算内
<input name="budget" type="radio" value="预算外">预算外
</span>
                    </td>
                </tr>
                <tr class="aprvl-table-row trStartEndDate">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        起止日期<br>Start/End Date

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <img align="bottom" alt="tag{'tagType': 'calendar', 'name': 'StartDate1', 'value': 'sysdate', 'viewFormat': 'yyyy-MM-dd', 'onClose' : 'stdDateCheck'}" src="/neo/js/ewt/ext/formEditor/images/input_calendar.gif" border="0">
                        -
                        <img align="bottom" alt="tag{'tagType': 'calendar', 'name': 'EndDate1', 'value': 'sysdate', 'viewFormat': 'yyyy-MM-dd', 'onClose' : 'ednDateCheck'}" src="/neo/js/ewt/ext/formEditor/images/input_calendar.gif" border="0">( <input name="Term1" style="border: 0px currentColor; border-image: none; width: 20px;" size="3" readonly="">
                        天
                        <input name="Term2" style="border: 0px currentColor; border-image: none; width: 20px;" size="3" readonly="">
                        夜 )

                    </td>
                </tr>
                <tr class="aprvl-table-row trHappenDate">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        发生日期<br>Happen Date

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <img align="bottom" alt="tag{&quot;tagType&quot;: &quot;calendar&quot;, &quot;name&quot;: &quot;happenDate&quot;, &quot;value&quot;: &quot;sysdate&quot;, &quot;viewFormat&quot;: &quot;yyyy-MM-dd&quot;}" src="/neo/js/ewt/ext/formEditor/images/input_calendar.gif" border="0">

                    </td>
                </tr>
                <tr class="aprvl-table-row trMonth">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        月份<br>Month

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <select name="Month" style="width: 30%;" size="1"><option selected="selected" value="1月">1月</option><option value="2月">2月</option><option value="3月">3月</option><option value="4月">4月</option><option value="5月">5月</option><option value="6月">6月</option><option value="7月">7月</option><option value="8月">8月</option><option value="9月">9月</option><option value="10月">10月</option><option value="11月">11月</option><option value="12月">12月</option></select>

                    </td>
                </tr>
                <tr class="aprvl-table-row trEntertain">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        招待人数<br>Entertain

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <input name="entertain" id="entertain" style="width: 30%; text-align: right; -ms-ime-mode: disabled;" onkeyup="checkValue(this);comma(this);" onkeypress="checkValue(this);" onblur="checkValue(this);comma(this);" onpaste="setPaste(AmountInWords);" type="text">

                    </td>
                </tr>
                <tr class="aprvl-table-row trLocation">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        出差地<br>Travel Location

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <input name="location" class="form-txt-width-full" type="text" size="12">

                    </td>
                </tr>
                <tr class="aprvl-table-row trStartEndLocation">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        出发/目的地<br>Start/End Location

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <input name="startLocation" style="width: 35%;" type="text" size="12">
                        —
                        <input name="endLocation" style="width: 35%;" type="text" size="12">

                    </td>
                </tr>
                <tr class="aprvl-table-row trHotelName">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        酒店<br>Hotel Name

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <input name="hotelName" class="form-txt-width-full" type="text" size="12">

                    </td>
                </tr>
                <tr class="aprvl-table-row trDaySubsidy">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        日补贴<br>Day Subsidy

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <input name="daySubsidy" id="daySubsidy" style="width: 30%; text-align: right; -ms-ime-mode: disabled;" onkeyup="checkValue(this);comma(this);" onkeypress="checkValue(this);" onblur="checkValue(this);comma(this);" onpaste="setPaste(AmountInWords);" type="text" value="80">

                    </td>
                </tr>
                <tr class="aprvl-table-row trAmount1">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        金额<br>Amount

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <input name="amount" id="amount" style="width: 30%; text-align: right; -ms-ime-mode: disabled;" onkeyup="checkValue(this);currencyComma(this);" onkeypress="checkValue(this);" onblur="checkValue(this);currencyComma(this);" onpaste="setPaste(AmountInWords);" type="text">

                    </td>
                </tr>
                <tr class="aprvl-table-row trAmount2">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        单价/数量/金额<br>Price/Count/Amount

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <input name="materialPrice" id="materialPrice" style="width: 25%; text-align: right; -ms-ime-mode: disabled;" onkeyup="checkValue(this);comma(this);" onkeypress="checkValue(this);" onblur="checkValue(this);comma(this);" onpaste="setPaste(AmountInWords);" type="text">
                        *
                        <input name="materialCount" id="materialCount" style="width: 25%; text-align: right; -ms-ime-mode: disabled;" onkeyup="checkValue(this);comma(this);" onkeypress="checkValue(this);" onblur="checkValue(this);comma(this);" onpaste="setPaste(AmountInWords);" type="text">
                        =
                        <input name="materialAmount" id="materialAmount" style="width: 25%; text-align: right; -ms-ime-mode: disabled;" onkeyup="checkValue(this);comma(this);" onkeypress="checkValue(this);" onblur="checkValue(this);comma(this);" onpaste="setPaste(AmountInWords);" type="text">

                    </td>
                </tr>
                <tr class="aprvl-table-row">
                    <th align="left" class="aprvl-table-head dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                        备注<br>Remark

                    </th>
                    <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
                        <input name="remark" class="form-txt-width-full" type="text" size="33">

                    </td>
                </tr>
                <tr class="aprvl-table-row">
                    <td align="center" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="2">
                        <span class="button center"><a onclick="AccountDivConfirm()">确认</a><span class="button center"><a onclick="AccountDivCancel()">取消</a></span></span>
                    </td>
                </tr>
                <tr class="aprvl-table-row">
                    <td align="center" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="2">
                        <p align="left" style="margin: 0pt 0pt 0pt 10pt;"><font id="strNote" color="red">注：</font></p>
                    </td>
                </tr>
                </tbody>
            </table>
        </div></div></c:if>


<br>
<table class="aprvl-table-basic" dyn_button="TbItem" dyn_startrow="3">
    <tbody>
    <tr class="aprvl-table-row">
        <td align="right" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="7">
            <span class="button center"><a name="TbItem_add1" id="TbItem_add1" onclick="accountInputDivControl()">新增</a><input name="TbItem_add" id="TbItem_add" style="display: none;" type="button"><a name="TbItem_del" id="TbItem_del" style="display: none;">删除</a><a name="TbItem_del1" id="TbItem_del1" onclick="DeleteSumAmount()">删除</a></span>

        </td>
    </tr>
    <tr class="aprvl-table-row">
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            项数<br>Item

        </th>
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            费用类别<br>Expense Type

        </th>
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            成本中心<br>Cost Center

        </th>
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            预算内(外)<br>within/out budget

        </th>
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            日期<br>Date

        </th>
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            金额<br>Amount

        </th>
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            费用说明<br>
            Expense Explanation

        </th>
    </tr>
    <tr class="aprvl-table-row">
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <span name="selectNo">1</span>

        </td>
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="mAccountType" class="form-txt-width-full" type="text" size="11" configmode="view"><input type="hidden" id="" name="businessCode" value="" class="" title="">

        </td>
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="mCostCode" class="form-txt-width-full" type="text" size="11" configmode="view">

        </td>
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="mBudget" class="form-txt-width-full" type="text" size="11" configmode="view">

        </td>
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="mDate" class="form-txt-width-full" type="text" size="3" configmode="view">

        </td>
        <td align="right" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="mAmount" class="form-txt-width-full" type="text" size="7" configmode="view">

        </td>
        <td align="left" class="aprvl-table-data dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="mRemark" class="form-txt-width-full" type="text" configmode="view"><input type="hidden" id="" name="aufnr" value="" class="" title="">

        </td>
    </tr>
    <tr class="aprvl-table-row">
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l" colspan="7">
            <input name="subTotal" class="form-txt-width-full" style="text-align: center;" type="text" size="13" configmode="view">

        </td>
    </tr>
    </tbody>
</table>



<c:if test="${doc.view}"><script language="javascript">
    $(function () {
        $(".dynamicTbWriteMode").hide();
    });
</script></c:if>


<br>


<table class="aprvl-table-basic"><colgroup><col width="100"><col width="100"><col width="110"><col width="110"><col width="120"><col width="120"><col width="130"><col width=""></colgroup>
    <tbody>
    <tr class="aprvl-table-row">
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            预支金额<br>
            Cash Advance

        </th>
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="cashAmount" class="form-txt-width-full" type="text" size="9" configmode="view">

        </td>
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            报销费用<br>
            Report
            Total

        </th>
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="reportTotal" class="form-txt-width-full" type="text" size="7" configmode="view">

        </td>
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            冲减预支金额<br>
            Write-downs Cash Advance

        </th>
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <p><input name="returnAmount" class="form-txt-width-full" id="returnAmount" style="text-align: right; -ms-ime-mode: disabled;" onkeyup="checkValue(this);currencyComma(this);" onkeypress="checkValue(this);" onblur="checkValue(this);currencyComma(this);" onpaste="setPaste(AmountInWords);" type="text" size="10" value="0.00"></p>
        </td>
        <th align="center" class="aprvl-table-head align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

            实际支付员工金额<br>
            Amount
            due to traveler

        </th>
        <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">
            <input name="dueToAmount" class="form-txt-width-full" type="text" size="14" configmode="view">

        </td>
    </tr>
    </tbody>
</table>




<div class="TravelContents" id="DomesticDesc">

    <table class="aprvl-table-basic">
        <tbody>
        <tr class="aprvl-table-row">
            <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                Domestic 旅费基准表

            </td>
        </tr>
        </tbody>
    </table>
</div>
<div class="TravelContents" id="AbroadDesc">

    <table class="aprvl-table-basic">
        <tbody>
        <tr class="aprvl-table-row">
            <td align="center" class="aprvl-table-data align-center dext_table_border_t dext_table_border_r dext_table_border_b dext_table_border_l">

                Abroad 旅费基准表

            </td>
        </tr>
        </tbody>
    </table>
</div>
<input type="hidden" id="" name="dayAmountSum" value="" class="" title="">


<c:if test="${!doc.print}">&nbsp;&nbsp;&nbsp;相关规定说明:
    <p align="left" style="margin: 0pt 0pt 0pt 10pt;"><a href="/neo/file/download.mvc?path=user_guide/HSOL Approval Authority Matrix.pdf&amp;name=HSOL Approval Authority Matrix.pdf&amp;module=approval&amp;isGroup=false" target="_blank"><font color="blue">1、《付款审批权限体系/Payment Approval Authority Matrix</font></a><font color="blue">》</font></p><p align="left" style="margin: 0pt 0pt 0pt 10pt;"><font color="blue"><a onclick="javascript: fnAppr4BbsNewPopup('000083211','5815', 'COMPANY');return false;" href="#" target="_blank">2、《出差报销管理制度/Regulation of business traveling reimbursement》</a></font></p><p align="left" style="margin: 5pt 0pt 0pt 10pt;"><font color="red">注：</font>1.Expense reimbursement application
        (in OA) and all receipts and support documents (hard copy) must be submitted
        within 5 working days in the following month the latest</p><p align="left" style="margin: 5pt 0pt 0pt 10pt;">当月的费用，OA里的报销申请表和发票及其他支持性文件(原件)最晚于下月开始5个工作日内递交.</p><p align="left" style="margin: 5pt 0pt 0pt 10pt;">2.Pls attach receipts (scanned copy) in OA form when you make reimbursement request</p><p align="left" style="margin: 5pt 0pt 0pt 10pt;">请在OA中进行费用报销时，将相关发票等证明性文件(扫描件即可)上传作为附件.</p><p align="left" style="margin: 5pt 0pt 0pt 10pt;">3.Cellphone
        expenses should be charged on an actual basis within the maximum amount set
        by Company Cellphone Policy, monthly cellphone bills is required as a support
        document for reimbursement</p><p align="left" style="margin: 5pt 0pt 0pt 10pt;">手机费应根据公司手机费报销政策，在限额内实报实销，进行报销时必须将手机费帐单(非充值发票)作为证明性文件一并递交.</p><p align="left"><br></p></c:if>

<c:if test="${doc.write and !doc.modify and !doc.rewrite}"><script language="javascript">
    $("#TbItem_count").val(parseInt($("#TbItem_count").val()) - 1);
</script></c:if>

<br>
<p><br></p>
